from salary import settings
from django.core.mail import EmailMultiAlternatives, send_mail, send_mass_mail  # send_mass_mail一个连接发送多个邮件


# 发送邮件
def SentMail(subject, contents, to_address):
    from_mail = settings.DEFAULT_FROM_EMAIL
    msg = EmailMultiAlternatives(subject, contents, from_mail, [to_address])
    msg.content_subtype = 'html'
    if msg.send():
        return True
    else:
        return False
